<div class="container-fluid">
    <div class="row-fluid">
        <div class="span3">
            <?php echo $this->partial('_menu.phtml');?>
            <!--/.well -->
        </div>
        <!--/span-->
        <div class="span9">
            <div class="wrap">
                <div id="main-content">
                	<div class="top-link"><a href="<?php echo $this->baseUrl() ?>/admin/presse/add-presse">Ajouter un article de presse</a></div>
                    <table>
                        <thead style="width:100% ">
                            <tr>
                                <th style="width:10% ">Date</th>
                                <th style="width:60% ">Titre</th>
                                <th style="width:10% ">Editer</th>
                                <th style="width:10% ">Supprimer</th>
                            </tr>
                        </thead>
                        <tfoot>
                            <tr>
                                <td colspan="6">
                                    <?php if(count($this->paginator) > 1) :?>
                                        <?php echo $this->paginationControl($this->paginator, 'Sliding', '_pagination.phtml'); ?>
                                    <?php endif;?>
                                    <!-- End .pagination -->

                                    <div class="clear"></div>
                               </td>
                            </tr>
                        </tfoot>
                        <tbody>
                        <?php
                        foreach($this->paginator  as $pr) :
                            $dtpubli = new DateTime($pr['dtpubli']);
                        ?>
                            <tr>
                                <td style="text-align:left;"><?php echo $dtpubli->format('d/m/Y');?></td>
                                <td style="text-align:left;"><?php echo $pr['titre'] ?></td>
                                <td>
                                	<a href="<?php echo $this->baseUrl() ?>/admin/presse/add-presse/id/<?php echo $pr['p_presse']?>"><img src="<?php echo $this->baseUrl() ?>/images/pencil.png"></a>
                                </td>
                                <td>
                                	<a href="javascript:void(0)" id="<?php echo $pr['p_presse']?>" class="delete"><img src="<?php echo $this->baseUrl() ?>/images/cross.png"></a>
                                </td>
                            </tr>
                         <?php endforeach ?>
                        </tbody>
                    </table>
                </div>
            </div>
            <!--/row-->
        </div>
        <!--/span-->
    </div>
    <!--/row-->
</div>
<script type="text/javascript">
$(document).ready(function(){
	$('.delete').click(function(){
		if (confirm("Etes-vous sûr de vouloir effacer?")) {
			var baseUrl = '<?php echo $this->baseUrl()?>';
			var id = $(this).attr('id');
			var page = '<?php echo $this->page ?>';
			document.location.href = baseUrl + '/admin/presse/delete-presse/id/'+ id +'/page/'+ page;
		}
  	});
});
</script>